//
//  ViewController.m
//  BZAppBaseComponent
//
//  Created by quheng on 2017/9/30.
//  Copyright © 2017年 quheng. All rights reserved.
//

#import "ZZFAppBaseComponentVC.h"
#import <Masonry/Masonry.h>
#import <BZUCComponent/BZUCComponent.h>

static NSString *cellID = @"cell";


@interface ZZFAppBaseComponentVC ()<UITableViewDelegate,UITableViewDataSource>


@property (nonatomic, copy) NSArray *datas;

@end

@implementation ZZFAppBaseComponentVC

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UITableView *tableV = [[UITableView alloc]init];
    tableV.dataSource = self;
    tableV.delegate = self;
    [tableV registerClass:[UITableViewCell class] forCellReuseIdentifier:cellID];
    [self.view addSubview:tableV];
    
    [tableV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
        make.size.mas_offset(self.view.frame.size);
    }];
    
}


- (NSArray *)datas{

    if (!_datas) {
        _datas = @[@"登录"];
    }
    return _datas;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{

    return 1;

}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return self.datas.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    cell.textLabel.text = self.datas[indexPath.row];
    return cell;
}



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{


    BZUCLoginVC *loginVC = [[BZUCLoginVC alloc]init];
    [self.navigationController pushViewController:loginVC animated:NO];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}



@end
